5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
- Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 4-6: ILF Keyword Reference

CNV BIN


The CNV BIN instruction converts an alpha field containing a binary number to or from a numeric field. This may be useful when operating on single characters of alpha-type fields, such as when you want to convert an alpha field from lower case to upper case.

  ?????    CNV BIN  ??? ?????????????????????? ??? = ??? ?????????????????????? ???
  (1)               (2) (3)                    (4)   (5) (6)                    (7)

(1) T/F execution conditions
(2) Destination application ID
(3) Destination field name or PDF
(4) Destination occ (constant/index)
(5) Source application ID
(6) Source field name, PDF, or constant
(7) Source occurrence (constant/index)

Using the Statement

If the source field is an alpha field, it is evaluated as a one-, two-, or four-byte binary value, depending on its length, and converted to the numeric destination field.

If the source field is a numeric field, its numeric value is converted into a one-, two-, or four-byte binary number, depending on the length of the destination field. The source field will be rounded to a whole number.

Restrictions

For an alpha source field, a numeric overflow condition occurs if the destination field is not large enough to store the converted value. The destination field must be numeric.

For a numeric source field, the destination must be alpha and between one, two, or four bytes in size. Based on the size of the destination field and the sign, the numeric value of the second field used in the conversion must be within the range specified below, or a numeric overflow condition occurs:

one byte signed:

-128 through +127

two bytes signed:

-32,768 through +32,767

four bytes signed:

-2,147,483,648 through +2,147,483,647

one byte unsigned:

0 through 255

two bytes unsigned:

0 through 65,535

four bytes unsigned:

0 through 4,294,967,295

Overflow processing is dependent on the use of OVERFLOW statements within the current event point.

Compilation Errors

The alpha field must be one, two, or four characters in length or a compile error occurs.

Related Statements

OVERFLOW

Example

The following example demonstrates how to convert an ASCII letter from lower case to upper case: 

         CNV BIN  TAR WORK NUMBER                  =  TAR ALPHA FIELD
         COMPUTE  TAR WORK NUMBER                  -      32
         CNV BIN  TAR ALPHA FIELD                  =  TAR WORK NUMBER

In this example, the alpha character is converted into a binary number (WORK NUMBER); then, the decimal value of 32 is subtracted from the field, producing the binary value of an uppercase letter. Finally, this value is converted back to its alpha representation.

Application Design Manual                                         "Powered by Appx Software"

627

©2006 By APPX Software, Inc. All Rights Reserved